package com.mvvm.ktnet.base

import android.os.Bundle
import com.mvvm.ktnet.base.viewmodel.BaseViewModel

/**
 *
 * @ProjectName:    KtNet
 * @Package:        com.mvvm.ktnet.base
 * @ClassName:      IBaseView
 * @Description:     java类作用描述
 * @Author:         Alex
 * @CreateDate:     2020/11/12 10:48
 * @UpdateUser:     更新者：
 * @UpdateDate:     2020/11/12 10:48
 * @UpdateRemark:   更新说明：
 * @Version:        1.0
 */
interface IBaseView {

    /**
     * 初始化view
     */
    fun initView(savedInstanceState: Bundle?)

    /**
     * 创建LiveData数据观察者
     */
    fun createObserver()
    fun initDataBind()
    fun initData()
    fun secondLoad()

    fun immersionBarEnabled(): Boolean
    fun initStatusBar()

    fun initRefreshLayout()
    fun registerUiChange()
    fun addLoadingObserve(vararg viewModels: BaseViewModel)
    fun reLoad()

    //页面内嵌
    fun showLoading(message: String = "请求网络中...")
    fun showError(message: String = "")
    fun showEmpty(message: String = "")
    fun showSuccess(message: String = "")

    //dialog
    fun showDialogLoading(message: String = "请求网络中...")
    fun showDialogError(message: String = "")
    fun showDialogEmpty(message: String = "")
    fun dismissDialogLoading()


    fun initLoad()

    fun registorDefErrorChange()
    fun onError(matcCode: Int, throwable: Throwable)
    fun onEmpty(matcCode: Int, throwable: Throwable)
    fun onFinally(matcCode: Int)


}